<?php echo '<?xml version="1.0" encoding="UTF-8" ?>'."\n"; // have to echo() this ?>
<entries>
	<count><?php if ($content) echo $content->num_rows(); ?><?php if (!$content) echo '0'; ?></count>
<?php
if ($content):
	foreach ($content->result() as $entry):
		$type = $this->Content_model->get_content_type($entry->content_type_id);
?>
	<entry id="<?php echo $entry->id; ?>">
		<title><![CDATA[<?php echo xml_convert(htmlentities($entry->field1_value, ENT_COMPAT, 'UTF-8')); ?>]]></title>
		<data><![CDATA[<?php echo xml_convert(htmlentities($entry->search_field2, ENT_COMPAT, 'UTF-8')); ?>]]></data>
		<entry_type id="<?php echo $type->id; ?>"><?php echo xml_convert($type->name); ?></entry_type>
		<engagements caption="<?php echo xml_convert($BBX['bricabox']->engage_term_past_tense); ?>" type="<?php echo $BBX['bricabox']->engagement_type; ?>"><?php echo $entry->cached_eng_count; ?></engagements>
		<permalink><?php echo str_replace('://', "://{$BBX['bricabox']->subdomain}.", APP_ROOT_URL); ?><?php echo content_url($entry); ?></permalink>
	</entry>
<?php
	endforeach;
endif;
?>
</entries>
